<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3d立方体</title>
    <style>
        .box{
            transform-style: preserve-3d;
            width: 300px;
            margin:200px auto;
            position: relative;
            transform: rotateX(30deg) rotateY(30deg) rotateZ(30deg);
        }
        .box>div{
            width: 300px;
            height: 300px;
            border: 2px solid #000;
            box-sizing: border-box;
            position: absolute;
        }
        .box1{
            background: red;
        }
        .box6{
            background: rgb(240, 89, 19);
            transform: translateZ(300px);
        }
        .box2{
            background: yellow;
            transform: rotateY(-90deg);
            transform-origin: left;
        }
        .box5{
            background: rgb(235, 220, 9);
            transform: rotateY(90deg);
            transform-origin: right;
        }
        .box3{
            background: green;
            transform: rotateX(90deg);
            transform-origin: top;
        }
        .box4{
            background: rgb(50, 214, 9);
            transform: rotateX(-90deg);
            transform-origin: bottom;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="box1">1</div>
        <div class="box2">2</div>
        <div class="box3">3</div>
        <div class="box4">4</div>
        <div class="box5">5</div>
        <div class="box6">6</div>
    </div>
</body>
</html>